Substitute Nick Powell scored an 11-minute hat-trick as Wigan boosted their Championship survival hopes by coming from 2-0 down to beat Barnsley.